﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom.Compiler;

namespace RobotBattle2.Scripting {
	public sealed class WhileLoopStatement : LoopStatementBase {
		public Expression Condition { get; set; }

		public StatementCollection Statements { get { return m_Statements; } }
		private StatementCollection m_Statements = new StatementCollection();

		public override void Dump(IndentedTextWriter writer) {
			writer.Write("while (");
			Condition.Dump(writer);
			writer.WriteLine(")");
			Statements.Dump(writer);
			writer.WriteLine("endif");
		}

		public override StatementType Type { get { return StatementType.WhileLoop; } }
	}
}
